<!DOCTYPE html>
<html lang="en">
<link href="css/bootstrap.css" rel="stylesheet">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<div class="container">
    <h2>订单明细</h2>
    <table class="table">
        <thead>
        <tr>
            <th>商品预览图</th>
            <th>商品名</th>
            <th>数量</th>
            <th>单价</th>
            <th>收货人</th>
            <th>收货地址</th>
            <th>预计送达</th>
        </tr>
        </thead>
        <tbody>
        </tbody>
    </table>
</div>
</body>
<script src="js/jquery-3.2.1.js"></script>
<script src="js/layer/layer.js"></script>
<script src="js/global.js"></script>
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/js.js"></script>
<script src="js/wb.js" type="text/javascript" charset="utf-8"></script>
<script src="js/MagicZoom.js" type="text/javascript"></script>
<script>
    $(function () {
        getAllProduct(null);
    })
    function getAllProduct(name) {
        $('tbody').empty();
        $.getJSON('queryForm.do', {pname: name}, function (data) {
            if (data.code) {
                $.each(data.result, function (index, obj) {
                    console.log(obj);
                    var tr = $('<tr></tr>');
                    var img = $('<img width="100" height="50">').attr('src', baseUrl + obj.picture)
                    tr.append(img);
                    var td1 = $('<td></td>').text(obj.pname);
                    var td2 = $('<td></td>').text(obj.count);
                    var td3 = $('<td></td>').text(obj.price);
                    var td4 = $('<td></td>').text(obj.uname);
                    var td5 = $('<td></td>').text(obj.address);
                    var td6 = $('<td></td>').text(obj.day);
                    tr.append(td1).append(td2).append(td3).append(td4).append(td5).append(td6);
                    $('tbody').append(tr).append("");
                })
            }
        })
    }

</script>
</html>